package cn.six1943.deepchat.module.ai.dal.mysql.chatsession;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.six1943.deepchat.module.ai.dal.dataobject.chatsession.ChatSessionDO;
import org.apache.ibatis.annotations.Mapper;
import cn.six1943.deepchat.module.ai.controller.admin.chatsession.vo.*;

/**
 * 会话 Mapper
 *
 * @author noday
 */
@Mapper
public interface ChatSessionMapper extends BaseMapperX<ChatSessionDO> {

    default PageResult<ChatSessionDO> selectPage(ChatSessionPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<ChatSessionDO>()
                .eqIfPresent(ChatSessionDO::getBizType, reqVO.getBizType())
                .eqIfPresent(ChatSessionDO::getBizId, reqVO.getBizId())
                .eqIfPresent(ChatSessionDO::getSummary, reqVO.getSummary())
                .eqIfPresent(ChatSessionDO::getRemark, reqVO.getRemark())
                .eqIfPresent(ChatSessionDO::getCreateDept, reqVO.getCreateDept())
                .orderByDesc(ChatSessionDO::getId));
    }

}